class ChangeDeliverableStatusAndResourcesColumnTypes < ActiveRecord::Migration
  def self.up
    add_column :deliverables, :status_id, :integer

    create_table :resources do |t|
      t.column :name, :string
    end

    create_table :assignments do |t|
      t.column :deliverable_id, :integer
      t.column :resource_id, :integer
    end

    remove_column :deliverables, :resources
    remove_column :deliverables, :status
  end

  def self.down
    add_column :deliverables, :status, :string
    add_column :deliverables, :resources, :string
    
    drop_table :assignments
    drop_table :resources
    remove_column :deliverables, :status_id
  end
end
